<!--
  @author chongw
  @since 2021-05-28 17:05:29
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<table class="layui-hide" id="zmn-table" lay-filter="zmn-table" th:fragment="table">
    <thead >
        <tr>
            <th lay-data="{field:'thresholdId',type:'checkbox',unresize:true, align:'center', fixed:'left'}"></th>
            <th lay-data="{field:'objMaster', unresize:true, align:'center'}">对象工号</th>
            <th lay-data="{field:'deptName',unresize:true, align:'center'}">对象部门</th>
            <th lay-data="{field:'ruleName', unresize:true, align:'center'}">对象名称</th>
            <th lay-data="{field:'level1', unresize:true, align:'center'}">一级预警</th>
            <th lay-data="{field:'level2',unresize:true, align:'center'}">二级预警</th>
            <th lay-data="{field:'level3',unresize:true, align:'center'}">三级预警</th>
            <th lay-data="{field:'status',unresize:true, align:'center'}">状态</th>
            <th lay-data="{field:'操作', unresize:true, align:'center', fixed:'right'}">操作</th>
        </tr>
    </thead>
    <tbody>
        <tr th:each="item:${items}">
            <td th:text="${item.thresholdId}"></td>
            <td th:text="${item.data.objMaster}"></td>
            <td th:text="${item.data.deptName}"></td>
            <td th:text="${item.data.objMasterName}"></td>
            <td th:text="${item.rule1.expression + item.rule1.value +'%'}"></td>
            <td th:text="${item.rule2.expression + item.rule2.value +'%'}"></td>
            <td th:text="${item.rule3.expression + item.rule3.value +'%'}"></td>
            <td>
                <div>
                    <input type="checkbox" name="status" id="status" th:key="${item.thresholdId}" th:value="${item.status}"
                           lay-text="ON|OFF" lay-skin="switch" lay-filter="chk_one_status"
                           th:checked="${item.status == 2}"/>
                </div>
            </td>
            <td>
                <a href="javascript:void(0)" lay-text="配置规则" style="color: #00a0e9" th:onclick="|ruleInfo(${item.thresholdId})|">配置规则</a>
            </td>
        </tr>
    </tbody>
</table>